-module('ex_7.15_flow_mapping').

-include_lib("eunit/include/eunit.hrl").

-define(FILENAME, "test/parsing/" ?MODULE_STRING ".yaml").

single_test_() ->
    ?_assertMatch(
      {yamerl_parser,
        {file,?FILENAME},
        [],
        <<>>,
        60,
        true,
        [],
        0,
        61,
        3,
        1,
        false,
        2,
        28,
        utf8,
        false,
        undefined,
        _,
        _,
        [],
        {bcoll,root,0,-1,1,1,-1,1,1},
        false,
        false,
        false,
        [{impl_key,false,false,undefined,undefined,1,1}],
        false,
        false,
        _,
        [],
        0,
        29,
        28,
        undefined,
        undefined,
        _,
        false,
        [],
        [
          {yamerl_stream_end,2,28},
          {yamerl_doc_end,2,28},
          {yamerl_collection_end,2,28,block,sequence},
          {yamerl_collection_end,2,27,flow,mapping},
          {yamerl_scalar,2,22,
            {yamerl_tag,2,22,{non_specific,"?"}},
            flow,plain,"eight"},
          {yamerl_mapping_value,2,20},
          {yamerl_scalar,2,14,
            {yamerl_tag,2,14,{non_specific,"?"}},
            flow,plain,"seven"},
          {yamerl_mapping_key,2,14},
          {yamerl_scalar,2,10,
            {yamerl_tag,2,10,{non_specific,"?"}},
            flow,plain,"six"},
          {yamerl_mapping_value,2,8},
          {yamerl_scalar,2,4,
            {yamerl_tag,2,4,{non_specific,"?"}},
            flow,plain,"five"},
          {yamerl_mapping_key,2,4},
          {yamerl_collection_start,2,3,
            {yamerl_tag,2,3,{non_specific,"?"}},
            flow,mapping},
          {yamerl_sequence_entry,2,1},
          {yamerl_collection_end,1,31,flow,mapping},
          {yamerl_scalar,1,24,
            {yamerl_tag,1,24,{non_specific,"?"}},
            flow,plain,"four"},
          {yamerl_mapping_value,1,22},
          {yamerl_scalar,1,17,
            {yamerl_tag,1,17,{non_specific,"?"}},
            flow,plain,"three"},
          {yamerl_mapping_key,1,17},
          {yamerl_scalar,1,11,
            {yamerl_tag,1,11,{non_specific,"?"}},
            flow,plain,"two"},
          {yamerl_mapping_value,1,9},
          {yamerl_scalar,1,5,
            {yamerl_tag,1,5,{non_specific,"?"}},
            flow,plain,"one"},
          {yamerl_mapping_key,1,5},
          {yamerl_collection_start,1,3,
            {yamerl_tag,1,3,{non_specific,"?"}},
            flow,mapping},
          {yamerl_sequence_entry,1,1},
          {yamerl_collection_start,1,1,
            {yamerl_tag,1,1,{non_specific,"?"}},
            block,sequence},
          {yamerl_doc_start,1,1,{1,2},_},
          {yamerl_stream_start,1,1,utf8}
        ]
      },
      yamerl_parser:file(?FILENAME)
    ).
